package pkg.entity;

import com.googlecode.objectify.Key;
import javax.persistence.Id;

public class Prefix extends ObjectifyEntity {

    @Id
    Long id;
    String prefix;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getPrefix() {
        return prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    public Key<Prefix> getKey() {
        return new Key<Prefix>(Prefix.class, id);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Prefix other = (Prefix) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 79 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public Key<ObjectifyEntity> getPrimaryKey() {
        return new Key(this.getClass(), id);
    }
}
